import createAxios from '/@/utils/axios'

const controllerUrl = '/admin/workorder.Orders/'

export function getFieldConfig(params: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'getFieldConfig',
        method: 'get',
        params: params,
    })
}

export function dashboard(params: anyObj = {}) {
    return createAxios({
        url: '/admin/workorder.Dashboard/index',
        method: 'get',
        params: params,
    })
}

/**
 * 聊天记录
 */
export function records(id: number, page = 1) {
    return createAxios({
        url: controllerUrl + 'records',
        method: 'get',
        params: { id, page },
    })
}

export function getWorkerList() {
    return createAxios({
        url: '/admin/workorder.Engineers/index',
        method: 'get',
    })
}

export function assign(data: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'assign',
        method: 'post',
        data: data,
    })
}

export function getReport(data: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'getReport',
        method: 'post',
        data: data,
    })
}
export function getDeepReport(data: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'getDeepReport',
        method: 'post',
        data: data,
    })
}
export function checkReport(data: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'checkReport',
        method: 'post',
        data: data,
    })
}
export function checkDeepReport(data: anyObj = {}) {
    return createAxios({
        url: controllerUrl + 'checkDeepReport',
        method: 'post',
        data: data,
    })
}
